API Documentation
Static Public Member Functions | List of all members
nkAstraeus::lua::ByteArrayWrapper Class Referencefinal

Wraps a nkAstraeus::ByteArrayData and offers functions for use in scripting. More...

Static Public Member Functions

static void updateEnvironment (nkScripts::Environment *env)
 
static nkScripts::OutputValue constructor (const nkScripts::DataStack &stack)
 
static void destructor (void *toDestroy)
 
static nkScripts::OutputValue getData (void *data)
 
static nkScripts::OutputValue getSize (void *data)
 
static nkScripts::OutputValue subView (const nkScripts::DataStack &stack)
 

Detailed Description

Wraps a nkAstraeus::ByteArrayData and offers functions for use in scripting.

Member Function Documentation

◆ updateEnvironment()

static void nkAstraeus::lua::ByteArrayWrapper::updateEnvironment ( nkScripts::Environment env)
static

Updates a given environment and set it up to use all functions wrapped by this wrapper.

Parameters
envThe environment to set up.

◆ constructor()

static nkScripts::OutputValue nkAstraeus::lua::ByteArrayWrapper::constructor ( const nkScripts::DataStack stack)
static

Wrapper function for the constructor of the user type.

local t = nkByteArray.new() ;
Parameters
stackThe parameter stack.
Returns
An output value with the user type and data allocated.

◆ destructor()

static void nkAstraeus::lua::ByteArrayWrapper::destructor ( void *  toDestroy)
static

Wrapper function for the destructor of the user type.

Parameters
toDestroyThe data that has to be freed.

◆ getData()

static nkScripts::OutputValue nkAstraeus::lua::ByteArrayWrapper::getData ( void *  data)
static

Wrapper function for the ArrayData::_ptr attribute reading.

local d = t.data ;
Parameters
dataThe data from which the attribute will be retrieved.
Returns
The attribute value, as a nkAstraeus::ByteArrayData.

◆ getSize()

static nkScripts::OutputValue nkAstraeus::lua::ByteArrayWrapper::getSize ( void *  data)
static

Wrapper function for the ArrayData::_size attribute reading.

local s = t.data ;
Parameters
dataThe data from which the attribute will be retrieved.
Returns
The attribute value.

◆ subView()

static nkScripts::OutputValue nkAstraeus::lua::ByteArrayWrapper::subView ( const nkScripts::DataStack stack)
static

Wrapper function for ArrayData::subView.

local subView = t:subView(5, 10) ;
Parameters
stackThe parameter stack.
Returns
The output value, a nkAstraeus::ByteArrayData.

The documentation for this class was generated from the following file: